﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace Heavysoft.Mince.Models
{
    [Serializable]
    public class Photo
    {
        public const string KeyMaxId = "Mince.Photo.MaxId";
        public const string KeyItem = "Mince.Photo.{0}";

        public ulong ID { get; set; }
        
        [StringLength(200)]
        public string Name { get; set; }

        [StringLength(200)]
        public string OriginalName { get; set; }

        [Required]
        [StringLength(200)]
        public string Uri { get; set; }

        public string CacheKey
        {
            get
            {
                return Heavysoft.Mince.Support.CacheManager.MakeKey(KeyItem, ID);
            }
        }
    }
}